﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Infected_Defense_Squad
{

    class Menus : Soldier

    {
        public Menus(string name, string position, string priority, uint stress, uint paycheck, uint lvl, uint health, uint boredom) :
            base(name, position, priority, stress, paycheck, lvl, health, boredom) { }
        public static int mainResponse, gameResponse, posChange;
        private static string[] names = { "Joe", "Jack", "John", "Jharl", "Katlyn",
                             "Kirk", "Lee", "Tyler", "Amy", "Lily", "Emily",
                             "Luke", "Cortus", "Gorden", "Lois", "Hannah", "Bill",
                             "Johnny", "Rock", "Eric", "Malcome", "Trayquan", "Victor", 
                             "Rob", "Robby", "Robert", "Crystal", "Churk", "Harold", "Kortus"};
        public static bool mainMenuIsRunning, gameMainIsRunning;
        private const int NUM_SOLDIERS = 5;
        public static int NUM_SOLDIERS_NONCONST = NUM_SOLDIERS;
        public static Soldier[] soldiers;
        public static int minResponse;
        public static void MainMenu()
        {
            
            

            mainMenuIsRunning = true;

            while(mainMenuIsRunning)
            {
                Console.ForegroundColor = ConsoleColor.White;
                Console.Clear();
                Console.WriteLine("Infected Defense Squad");
                Console.WriteLine();
                Console.WriteLine("1. New Game");
                Console.WriteLine("2. Load Game");
                Console.WriteLine("3. Options");
                Console.WriteLine("4. Credits");
                Console.WriteLine("5. Quit");

                mainResponse = Convert.ToInt32(Console.ReadLine());
                
                switch(mainResponse)
                {
                    case 1:
                        mainMenuIsRunning = false;
                        gameMainIsRunning = true;
                        GameMain();
                        break;
                    default:
                        break;
                }
            }
        }
        public static uint day = 1;
        public static bool autoPay = false;
        public static void GameMain()
        {
            
            #region  Initialize the soldiers

            soldiers = new Soldier[NUM_SOLDIERS];

            Random randGen = new Random();
            for (int i = 0; i < NUM_SOLDIERS; i++)
            {
                int r = randGen.Next(1, 27);

                soldiers[i] = new Soldier(names[r], "Stand By", "(None)", 0, 20, 1, 50, 0);

            }
            #endregion 
            uint patrolChance = 0;
            uint budget = 10000;
            bool squadPayed = false;
            while(gameMainIsRunning)
            {
                Console.Clear();
                Console.WriteLine("I.D.S.");
                Console.WriteLine("Day: " + day);
                Console.WriteLine();
                Console.WriteLine("1. End Turn");
                Console.WriteLine("2. Manage Soliders");
                Console.WriteLine("3. Manage Research");
                Console.WriteLine("0. Quit");
                gameResponse = Convert.ToInt32(Console.ReadLine());
                switch (gameResponse)
                {
                    #region Manage Soldiers
                    case 2:
                        while (gameMainIsRunning)
                        {
                            //The user chooses to manage the soldiers
                            Console.Clear();
                            Console.WriteLine("I.D.S.");
                            Console.WriteLine(">Manage Soliders");
                            Console.WriteLine();
                            Console.WriteLine("1. List Soliders' Stats");
                            Console.WriteLine("2. Change Soldiers' Positions");
                            Console.WriteLine("3. Pay Squad Manually");
                            if (autoPay == false)
                            {
                                Console.WriteLine("4. Pay Squad Automatically (OFF)");
                            }
                            else
                            {
                                Console.WriteLine("4. Pay Squad Automatically  (ON)");
                            }
                            Console.WriteLine("0. Back");
                            minResponse = Convert.ToInt32(Console.ReadLine());
                            switch (minResponse)
                            {
                                #region List Soldiers' Stats
                                case 1:
                                    Console.Clear();
                                    Console.WriteLine("I.D.S.");
                                    Console.WriteLine(">> List Soldiers' Positions");
                                    Console.WriteLine();
                                    for (int i = 0; i < NUM_SOLDIERS; i++)
                                    {
                                        Console.WriteLine(soldiers[i].Statistics());
                                    }
                                    Console.WriteLine("Press Enter to return to menu");
                                    Console.ReadLine();
                                    break;
                                #endregion
                                #region Change Soldiers' Positions
                                case 2:
                                    while (gameMainIsRunning)
                                    {
                                        Console.Clear();
                                        Console.WriteLine("I.D.S.");
                                        Console.WriteLine(">>Change Soldiers' Positions");
                                        Console.WriteLine();
                                        for (int i = 1; i < (NUM_SOLDIERS+1); i++)
                                        {
                                            Console.WriteLine(i + ". " + soldiers[(i-1)].Statistics());
                                        }
                                        Console.WriteLine("0. Back");
                                        posChange = Convert.ToInt32(Console.ReadLine());
                                        if ((posChange <= (NUM_SOLDIERS + 1))&&(posChange != 0))
                                        {
                                            while (gameMainIsRunning)
                                            {
                                                Console.Clear();
                                                Console.WriteLine("What position would you like ot change " + soldiers[(posChange - 1)].Name + " to?");
                                                Console.WriteLine(soldiers[(posChange - 1)].Name + "'s current position is " + soldiers[(posChange - 1)].Position + " with a priority of " + soldiers[(posChange - 1)].Priority + ".");
                                                Console.WriteLine();
                                                Console.WriteLine("1. Stand By");
                                                Console.WriteLine("2. Patrol");
                                                Console.WriteLine("3. Train");
                                                Console.WriteLine("0. Back");
                                                minResponse = Convert.ToInt32(Console.ReadLine());
                                                switch (minResponse)
                                                {
                                                    case 1:
                                                        Console.Clear();
                                                        if (soldiers[(posChange - 1)].Position == "Patrol")
                                                        {
                                                            if (soldiers[(posChange - 1)].Priority == "(Low)")
                                                            {
                                                                patrolChance--;
                                                            }
                                                            else if (soldiers[(posChange - 1)].Priority == "(Normal)")
                                                            {
                                                                patrolChance -= 2;
                                                            }
                                                            else
                                                            {
                                                                patrolChance -= 3;
                                                            }
                                                        }
                                                        soldiers[(posChange - 1)].Position = "Stand By";
                                                        Console.WriteLine("You have successfully changed " + soldiers[(posChange - 1)].Name + "'s position to Stand By.");
                                                        Console.WriteLine("Press Any Key to Return");
                                                        Console.ReadKey(true);
                                                        gameMainIsRunning = false;
                                                        break;
                                                    case 2:
                                                        while (gameMainIsRunning)
                                                        {
                                                            Console.Clear();
                                                            Console.WriteLine("What Priority would you like that position to have?");
                                                            Console.WriteLine();
                                                            Console.WriteLine("1. Low");
                                                            Console.WriteLine("2. Normal");
                                                            Console.WriteLine("3. High");
                                                            Console.WriteLine("0. Back");
                                                            minResponse = Convert.ToInt32(Console.ReadLine());
                                                            switch (minResponse)
                                                            {
                                                                case 0:
                                                                    gameMainIsRunning = false;
                                                                    break;
                                                                case 1:
                                                                    if (soldiers[(posChange - 1)].Priority == "(Low)")
                                                                    {

                                                                    }
                                                                    else if (soldiers[(posChange - 1)].Priority == "(Normal)")
                                                                    {
                                                                        patrolChance--;
                                                                    }
                                                                    else if (soldiers[(posChange - 1)].Priority == "(High)")
                                                                    {
                                                                        patrolChance -= 2;
                                                                    }
                                                                    Console.Clear();
                                                                    soldiers[(posChange - 1)].Position = "Patrol";
                                                                    soldiers[(posChange - 1)].Priority = "(Low)";
                                                                    Console.WriteLine(soldiers[(posChange - 1)].Name + "'s position has been successfully changed to Patrol (Low).");
                                                                    Console.WriteLine("Press Any Key to Return");
                                                                    Console.ReadKey(true);
                                                                    gameMainIsRunning = false;
                                                                    break;
                                                                case 2:
                                                                    if (soldiers[(posChange - 1)].Priority == "(Low)")
                                                                    {
                                                                        patrolChance++;
                                                                    }
                                                                    else if (soldiers[(posChange - 1)].Priority == "(Normal)")
                                                                    {
                                                                        
                                                                    }
                                                                    else if (soldiers[(posChange - 1)].Priority == "(High)")
                                                                    {
                                                                        patrolChance--;
                                                                    }
                                                                    Console.Clear();
                                                                    soldiers[(posChange - 1)].Position = "Patrol";
                                                                    soldiers[(posChange - 1)].Priority = "(Normal)";
                                                                    Console.WriteLine(soldiers[(posChange - 1)].Name + "'s position has been successfully changed to Patrol (Normal).");
                                                                    Console.WriteLine("Press Any Key to Return");
                                                                    Console.ReadKey(true);
                                                                    gameMainIsRunning = false;
                                                                    break;
                                                                case 3:
                                                                    if (soldiers[(posChange - 1)].Priority == "(Low)")
                                                                    {
                                                                        patrolChance += 2;
                                                                    }
                                                                    else if (soldiers[(posChange - 1)].Priority == "(Normal)")
                                                                    {
                                                                        patrolChance++;
                                                                    }
                                                                    else if (soldiers[(posChange - 1)].Priority == "(High)")
                                                                    {
                                                                        
                                                                    }
                                                                    Console.Clear();
                                                                    soldiers[(posChange - 1)].Position = "Patrol";
                                                                    soldiers[(posChange - 1)].Priority = "(High)";
                                                                    Console.WriteLine(soldiers[(posChange - 1)].Name + "'s position has been successfully changed to Patrol (High).");
                                                                    Console.WriteLine("Press Any Key to Return");
                                                                    Console.ReadKey(true);
                                                                    gameMainIsRunning = false;
                                                                    break;
                                                            }
                                                        }
                                                        break;
                                                        
                                                    case 3:
                                                        if (soldiers[(posChange - 1)].Position == "Patrol")
                                                        {
                                                            if (soldiers[(posChange - 1)].Priority == "(Low)")
                                                            {
                                                                patrolChance--;
                                                            }
                                                            else if (soldiers[(posChange - 1)].Priority == "(Normal)")
                                                            {
                                                                patrolChance -= 2;
                                                            }
                                                            else
                                                            {
                                                                patrolChance -= 3;
                                                            }
                                                        }
                                                        Console.Clear();
                                                        soldiers[(posChange - 1)].Position = "Train";
                                                        soldiers[(posChange - 1)].Priority = "(None)";
                                                        Console.WriteLine(soldiers[(posChange - 1)].Name + "'s position has been successfully changed  to Train.");
                                                        Console.WriteLine("Press Any Key to Return");
                                                        Console.ReadKey(true);
                                                        gameMainIsRunning = false;
                                                        break;
                                                    case 0:
                                                        gameMainIsRunning = false;
                                                        break;

                                                }

                                            }
                                            gameMainIsRunning = true;
                                        }
                                        else if (posChange == 0)
                                        {
                                            gameMainIsRunning = false;
                                        }
                                    }
                                    gameMainIsRunning = true;
                                    break;
                                case 0:
                                    gameMainIsRunning = false;
                                    break;
                                #endregion
                                #region Pay Squad Manually
                                case 3:
                                    #region If Squad Hasn't Been Payed
                                    if (squadPayed == false)
                                    {
                                        Console.Clear();
                                        switch (NUM_SOLDIERS_NONCONST)
                                        {
                                            case 0:
                                                
                                                Console.WriteLine("You have no soldiers to pay!");
                                                Console.ReadKey(true);
                                                break;
                                            case 1:
                                                while (gameMainIsRunning)
                                                {
                                                    Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck));
                                                    Console.WriteLine("Are you sure you want to pay?");
                                                    Console.WriteLine();
                                                    Console.WriteLine("1. Yes");
                                                    Console.WriteLine("2. No");
                                                    minResponse = Convert.ToInt32(Console.ReadLine());
                                                    switch (minResponse)
                                                    {
                                                        case 1:
                                                            Console.Clear();
                                                            Console.WriteLine("Your squad has been successfully paid.");
                                                            squadPayed = true;
                                                            budget -= (soldiers[0].Paycheck);
                                                            gameMainIsRunning = false;
                                                            break;
                                                        case 2:
                                                            gameMainIsRunning = false;
                                                            break;
                                                    }
                                                }
                                                gameMainIsRunning = true;
                                                break;
                                            case 2:
                                                while (gameMainIsRunning)
                                                {
                                                    Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck));
                                                    Console.WriteLine("Are you sure you want to pay?");
                                                    Console.WriteLine();
                                                    Console.WriteLine("1. Yes");
                                                    Console.WriteLine("2. No");
                                                    minResponse = Convert.ToInt32(Console.ReadLine());
                                                    switch (minResponse)
                                                    {
                                                        case 1:
                                                            Console.Clear();
                                                            Console.WriteLine("Your squad has been successfully paid.");
                                                            squadPayed = true;
                                                            budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck);
                                                            gameMainIsRunning = false;
                                                            break;
                                                        case 2:
                                                            gameMainIsRunning = false;
                                                            break;
                                                    }
                                                }
                                                gameMainIsRunning = true;
                                                break;
                                            case 3:
                                                while (gameMainIsRunning)
                                                {
                                                    Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck));
                                                    Console.WriteLine("Are you sure you want to pay?");
                                                    Console.WriteLine();
                                                    Console.WriteLine("1. Yes");
                                                    Console.WriteLine("2. No");
                                                    minResponse = Convert.ToInt32(Console.ReadLine());
                                                    switch (minResponse)
                                                    {
                                                        case 1:
                                                            Console.Clear();
                                                            Console.WriteLine("Your squad has been successfully paid.");
                                                            squadPayed = true;
                                                            budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck);
                                                            gameMainIsRunning = false;
                                                            break;
                                                        case 2:
                                                            gameMainIsRunning = false;
                                                            break;
                                                    }
                                                }
                                                gameMainIsRunning = true;
                                                break;
                                            case 4:
                                                while (gameMainIsRunning)
                                                {
                                                    Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck));
                                                    Console.WriteLine("Are you sure you want to pay?");
                                                    Console.WriteLine();
                                                    Console.WriteLine("1. Yes");
                                                    Console.WriteLine("2. No");
                                                    minResponse = Convert.ToInt32(Console.ReadLine());
                                                    switch (minResponse)
                                                    {
                                                        case 1:
                                                            Console.Clear();
                                                            Console.WriteLine("Your squad has been successfully paid.");
                                                            squadPayed = true;
                                                            budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck);
                                                            gameMainIsRunning = false;
                                                            break;
                                                        case 2:
                                                            gameMainIsRunning = false;
                                                            break;
                                                    }
                                                }
                                                gameMainIsRunning = true;
                                                break;
                                            case 5:
                                                while (gameMainIsRunning)
                                                {
                                                    Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck));
                                                    Console.WriteLine("Are you sure you want to pay?");
                                                    Console.WriteLine();
                                                    Console.WriteLine("1. Yes");
                                                    Console.WriteLine("2. No");
                                                    minResponse = Convert.ToInt32(Console.ReadLine());
                                                    switch (minResponse)
                                                    {
                                                        case 1:
                                                            Console.Clear();
                                                            Console.WriteLine("Your squad has been successfully paid.");
                                                            squadPayed = true;
                                                            budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck);
                                                            gameMainIsRunning = false;
                                                            break;
                                                        case 2:
                                                            gameMainIsRunning = false;
                                                            break;
                                                    }
                                                }
                                                gameMainIsRunning = true;
                                                break;
                                            case 6:
                                                while (gameMainIsRunning)
                                                {
                                                    Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck));
                                                    Console.WriteLine("Are you sure you want to pay?");
                                                    Console.WriteLine();
                                                    Console.WriteLine("1. Yes");
                                                    Console.WriteLine("2. No");
                                                    minResponse = Convert.ToInt32(Console.ReadLine());
                                                    switch (minResponse)
                                                    {
                                                        case 1:
                                                            Console.Clear();
                                                            Console.WriteLine("Your squad has been successfully paid.");
                                                            squadPayed = true;
                                                            budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck);
                                                            gameMainIsRunning = false;
                                                            break;
                                                        case 2:
                                                            gameMainIsRunning = false;
                                                            break;
                                                    }
                                                }
                                                gameMainIsRunning = true;
                                                break;
                                            case 7:
                                                while (gameMainIsRunning)
                                                {
                                                    Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck + soldiers[6].Paycheck));
                                                    Console.WriteLine("Are you sure you want to pay?");
                                                    Console.WriteLine();
                                                    Console.WriteLine("1. Yes");
                                                    Console.WriteLine("2. No");
                                                    minResponse = Convert.ToInt32(Console.ReadLine());
                                                    switch (minResponse)
                                                    {
                                                        case 1:
                                                            Console.Clear();
                                                            Console.WriteLine("Your squad has been successfully paid.");
                                                            squadPayed = true;
                                                            budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck + soldiers[6].Paycheck);
                                                            gameMainIsRunning = false;
                                                            break;
                                                        case 2:
                                                            gameMainIsRunning = false;
                                                            break;
                                                    }
                                                }
                                                gameMainIsRunning = true;
                                                break;
                                            case 8:
                                                while (gameMainIsRunning)
                                                {
                                                    Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck + soldiers[6].Paycheck + soldiers[7].Paycheck));
                                                    Console.WriteLine("Are you sure you want to pay?");
                                                    Console.WriteLine();
                                                    Console.WriteLine("1. Yes");
                                                    Console.WriteLine("2. No");
                                                    minResponse = Convert.ToInt32(Console.ReadLine());
                                                    switch (minResponse)
                                                    {
                                                        case 1:
                                                            Console.Clear();
                                                            Console.WriteLine("Your squad has been successfully paid.");
                                                            squadPayed = true;
                                                            budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck + soldiers[6].Paycheck + soldiers[7].Paycheck);
                                                            gameMainIsRunning = false;
                                                            break;
                                                        case 2:
                                                            gameMainIsRunning = false;
                                                            break;
                                                    }
                                                }
                                                gameMainIsRunning = true;
                                                break;
                                            case 9:
                                                while (gameMainIsRunning)
                                                {
                                                    Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck + soldiers[6].Paycheck + soldiers[7].Paycheck + soldiers[8].Paycheck));
                                                    Console.WriteLine("Are you sure you want to pay?");
                                                    Console.WriteLine();
                                                    Console.WriteLine("1. Yes");
                                                    Console.WriteLine("2. No");
                                                    minResponse = Convert.ToInt32(Console.ReadLine());
                                                    switch (minResponse)
                                                    {
                                                        case 1:
                                                            Console.Clear();
                                                            Console.WriteLine("Your squad has been successfully paid.");
                                                            squadPayed = true;
                                                            budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck + soldiers[6].Paycheck + soldiers[7].Paycheck + soldiers[8].Paycheck);
                                                            gameMainIsRunning = false;
                                                            break;
                                                        case 2:
                                                            gameMainIsRunning = false;
                                                            break;
                                                    }
                                                }
                                                gameMainIsRunning = true;
                                                break;
                                            case 10:
                                                while (gameMainIsRunning)
                                                {
                                                    Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck + soldiers[6].Paycheck + soldiers[7].Paycheck + soldiers[8].Paycheck + soldiers[9].Paycheck));
                                                    Console.WriteLine("Are you sure you want to pay?");
                                                    Console.WriteLine();
                                                    Console.WriteLine("1. Yes");
                                                    Console.WriteLine("2. No");
                                                    minResponse = Convert.ToInt32(Console.ReadLine());
                                                    switch (minResponse)
                                                    {
                                                        case 1:
                                                            Console.Clear();
                                                            Console.WriteLine("Your squad has been successfully paid.");
                                                            squadPayed = true;
                                                            budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck + soldiers[6].Paycheck + soldiers[7].Paycheck + soldiers[8].Paycheck + soldiers[9].Paycheck);
                                                            gameMainIsRunning = false;
                                                            break;
                                                        case 2:
                                                            gameMainIsRunning = false;
                                                            break;
                                                    }
                                                }
                                                gameMainIsRunning = true;
                                                break;
                                        }
                                    }
                                    #endregion
                                    else if (squadPayed == true)
                                    {
                                        while (gameMainIsRunning)
                                        {
                                            Console.Clear();
                                            Console.WriteLine("Your squad has already been payed! Would you like to pay your squad again?");
                                            Console.WriteLine();
                                            Console.WriteLine("1. Yes");
                                            Console.WriteLine("2. No");
                                            minResponse = Convert.ToInt32(Console.ReadLine());
                                            switch (minResponse)
                                            {
                                                case 1:
                                                    #region Same as "If Squad Hasn't Been Payed"
                                                    Console.Clear();
                                                    switch (NUM_SOLDIERS_NONCONST)
                                                    {
                                                        case 0:

                                                            Console.WriteLine("You have no soldiers to pay!");
                                                            Console.ReadKey(true);
                                                            break;
                                                        case 1:
                                                            while (gameMainIsRunning)
                                                            {
                                                                Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck));
                                                                Console.WriteLine("Are you sure you want to pay?");
                                                                Console.WriteLine();
                                                                Console.WriteLine("1. Yes");
                                                                Console.WriteLine("2. No");
                                                                minResponse = Convert.ToInt32(Console.ReadLine());
                                                                switch (minResponse)
                                                                {
                                                                    case 1:
                                                                        Console.Clear();
                                                                        Console.WriteLine("Your squad has been successfully paid.");
                                                                        squadPayed = true;
                                                                        budget -= (soldiers[0].Paycheck);
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                    case 2:
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                }
                                                            }
                                                            gameMainIsRunning = true;
                                                            break;
                                                        case 2:
                                                            while (gameMainIsRunning)
                                                            {
                                                                Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck));
                                                                Console.WriteLine("Are you sure you want to pay?");
                                                                Console.WriteLine();
                                                                Console.WriteLine("1. Yes");
                                                                Console.WriteLine("2. No");
                                                                minResponse = Convert.ToInt32(Console.ReadLine());
                                                                switch (minResponse)
                                                                {
                                                                    case 1:
                                                                        Console.Clear();
                                                                        Console.WriteLine("Your squad has been successfully paid.");
                                                                        squadPayed = true;
                                                                        budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck);
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                    case 2:
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                }
                                                            }
                                                            gameMainIsRunning = true;
                                                            break;
                                                        case 3:
                                                            while (gameMainIsRunning)
                                                            {
                                                                Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck));
                                                                Console.WriteLine("Are you sure you want to pay?");
                                                                Console.WriteLine();
                                                                Console.WriteLine("1. Yes");
                                                                Console.WriteLine("2. No");
                                                                minResponse = Convert.ToInt32(Console.ReadLine());
                                                                switch (minResponse)
                                                                {
                                                                    case 1:
                                                                        Console.Clear();
                                                                        Console.WriteLine("Your squad has been successfully paid.");
                                                                        squadPayed = true;
                                                                        budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck);
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                    case 2:
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                }
                                                            }
                                                            gameMainIsRunning = true;
                                                            break;
                                                        case 4:
                                                            while (gameMainIsRunning)
                                                            {
                                                                Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck));
                                                                Console.WriteLine("Are you sure you want to pay?");
                                                                Console.WriteLine();
                                                                Console.WriteLine("1. Yes");
                                                                Console.WriteLine("2. No");
                                                                minResponse = Convert.ToInt32(Console.ReadLine());
                                                                switch (minResponse)
                                                                {
                                                                    case 1:
                                                                        Console.Clear();
                                                                        Console.WriteLine("Your squad has been successfully paid.");
                                                                        squadPayed = true;
                                                                        budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck);
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                    case 2:
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                }
                                                            }
                                                            gameMainIsRunning = true;
                                                            break;
                                                        case 5:
                                                            while (gameMainIsRunning)
                                                            {
                                                                Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck));
                                                                Console.WriteLine("Are you sure you want to pay?");
                                                                Console.WriteLine();
                                                                Console.WriteLine("1. Yes");
                                                                Console.WriteLine("2. No");
                                                                minResponse = Convert.ToInt32(Console.ReadLine());
                                                                switch (minResponse)
                                                                {
                                                                    case 1:
                                                                        Console.Clear();
                                                                        Console.WriteLine("Your squad has been successfully paid.");
                                                                        squadPayed = true;
                                                                        budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck);
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                    case 2:
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                }
                                                            }
                                                            gameMainIsRunning = true;
                                                            break;
                                                        case 6:
                                                            while (gameMainIsRunning)
                                                            {
                                                                Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck));
                                                                Console.WriteLine("Are you sure you want to pay?");
                                                                Console.WriteLine();
                                                                Console.WriteLine("1. Yes");
                                                                Console.WriteLine("2. No");
                                                                minResponse = Convert.ToInt32(Console.ReadLine());
                                                                switch (minResponse)
                                                                {
                                                                    case 1:
                                                                        Console.Clear();
                                                                        Console.WriteLine("Your squad has been successfully paid.");
                                                                        squadPayed = true;
                                                                        budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck);
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                    case 2:
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                }
                                                            }
                                                            gameMainIsRunning = true;
                                                            break;
                                                        case 7:
                                                            while (gameMainIsRunning)
                                                            {
                                                                Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck + soldiers[6].Paycheck));
                                                                Console.WriteLine("Are you sure you want to pay?");
                                                                Console.WriteLine();
                                                                Console.WriteLine("1. Yes");
                                                                Console.WriteLine("2. No");
                                                                minResponse = Convert.ToInt32(Console.ReadLine());
                                                                switch (minResponse)
                                                                {
                                                                    case 1:
                                                                        Console.Clear();
                                                                        Console.WriteLine("Your squad has been successfully paid.");
                                                                        squadPayed = true;
                                                                        budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck + soldiers[6].Paycheck);
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                    case 2:
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                }
                                                            }
                                                            gameMainIsRunning = true;
                                                            break;
                                                        case 8:
                                                            while (gameMainIsRunning)
                                                            {
                                                                Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck + soldiers[6].Paycheck + soldiers[7].Paycheck));
                                                                Console.WriteLine("Are you sure you want to pay?");
                                                                Console.WriteLine();
                                                                Console.WriteLine("1. Yes");
                                                                Console.WriteLine("2. No");
                                                                minResponse = Convert.ToInt32(Console.ReadLine());
                                                                switch (minResponse)
                                                                {
                                                                    case 1:
                                                                        Console.Clear();
                                                                        Console.WriteLine("Your squad has been successfully paid.");
                                                                        squadPayed = true;
                                                                        budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck + soldiers[6].Paycheck + soldiers[7].Paycheck);
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                    case 2:
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                }
                                                            }
                                                            gameMainIsRunning = true;
                                                            break;
                                                        case 9:
                                                            while (gameMainIsRunning)
                                                            {
                                                                Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck + soldiers[6].Paycheck + soldiers[7].Paycheck + soldiers[8].Paycheck));
                                                                Console.WriteLine("Are you sure you want to pay?");
                                                                Console.WriteLine();
                                                                Console.WriteLine("1. Yes");
                                                                Console.WriteLine("2. No");
                                                                minResponse = Convert.ToInt32(Console.ReadLine());
                                                                switch (minResponse)
                                                                {
                                                                    case 1:
                                                                        Console.Clear();
                                                                        Console.WriteLine("Your squad has been successfully paid.");
                                                                        squadPayed = true;
                                                                        budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck + soldiers[6].Paycheck + soldiers[7].Paycheck + soldiers[8].Paycheck);
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                    case 2:
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                }
                                                            }
                                                            gameMainIsRunning = true;
                                                            break;
                                                        case 10:
                                                            while (gameMainIsRunning)
                                                            {
                                                                Console.WriteLine("Paying your squad will cost $" + (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck + soldiers[6].Paycheck + soldiers[7].Paycheck + soldiers[8].Paycheck + soldiers[9].Paycheck));
                                                                Console.WriteLine("Are you sure you want to pay?");
                                                                Console.WriteLine();
                                                                Console.WriteLine("1. Yes");
                                                                Console.WriteLine("2. No");
                                                                minResponse = Convert.ToInt32(Console.ReadLine());
                                                                switch (minResponse)
                                                                {
                                                                    case 1:
                                                                        Console.Clear();
                                                                        Console.WriteLine("Your squad has been successfully paid.");
                                                                        squadPayed = true;
                                                                        budget -= (soldiers[0].Paycheck + soldiers[1].Paycheck + soldiers[2].Paycheck + soldiers[3].Paycheck + soldiers[4].Paycheck + soldiers[5].Paycheck + soldiers[6].Paycheck + soldiers[7].Paycheck + soldiers[8].Paycheck + soldiers[9].Paycheck);
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                    case 2:
                                                                        gameMainIsRunning = false;
                                                                        break;
                                                                }
                                                            }
                                                            break;
                                                    }
                                                    #endregion
                                                    gameMainIsRunning = false;
                                                    break;
                                                case 2:
                                                    gameMainIsRunning = false;
                                                    break;

                                            }
                                            
                                        }
                                        gameMainIsRunning = true;
                                    }
                                    break;
                                #endregion
                                #region Pay Squad automatically
                                case 4:
                                    switch (autoPay)
                                    {
                                        case true:
                                            autoPay = false;
                                            break;
                                        case false:
                                            autoPay = true;
                                            break;
                                    }
                                    break;
                                #endregion

                            }
                                
                            
                        }
                        gameMainIsRunning = true;
                            break;
                    #endregion
                    #region Manage Research
                    case 3:
                            while (gameMainIsRunning)
                            {
                                Console.Clear();
                                Console.WriteLine("I.D.S.");
                                Console.WriteLine(">Manage Research");
                                Console.WriteLine();
                                Console.WriteLine("1. New Project");
                                Console.WriteLine("2. Current Projects");
                                Console.WriteLine("3. Finished Projects");
                                Console.WriteLine("4. Hire Scientists");
                                Console.WriteLine("5. Perform Experiment");
                                Console.WriteLine("6. Perform Autopsy Manually");
                                Console.WriteLine("7. Perform Autopsy Automatically");
                                Console.WriteLine("0. Back");
                                minResponse = Convert.ToInt32(Console.ReadLine());
                                switch (minResponse)
                                {
                                    case 0:
                                        break;
                                    case 1:
                                        break;
                                    case 2:
                                        break;
                                    case 3:
                                        break;
                                    case 4:
                                        break;
                                    case 5:
                                        break;
                                    case 6:
                                        break;
                                    case 7:
                                        break;

                                }
                            }
                        break;
                    #endregion
                    #region Quit Game
                    case 0:
                        //The user chooses to exit
                        gameMainIsRunning = false;
                        break;
                    #endregion
                }
            }
        }
    }
}